// Variables
$grid-gap: 40px;
$grid-gap-lg: 80px;

// General stuff ---------------------------------------------------------------

body {
  position: relative; // Makes scrollspy work better
}

section {
  position: relative;
}

// Landings can be borderless full-width so bg images can touch the edges
.landing {
  padding: 0;
}

// Square blocks ---------------------------------------------------------------

.square {
  position: relative;
  flex-basis: calc(50% - 30px); // Mobile
  margin: 15px;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  border-radius: $border-radius-lg;

  &::before {
    content: '';
    display: block;
    padding-top: 100%;
  }

  @include media-breakpoint-up(lg) {
    flex-basis: calc(25% - 30px);
  }

  &-50 {
    flex-basis: calc(50% - 30px);
    @include media-breakpoint-down(sm) {
      flex-basis: calc(50% - 20px);
    }
  }
}

// Nav grids -------------------------------------------------------------------

.nav-grid-lg {
  display: flex;
  flex-direction: column;

  .nav-item {
    width: 100%;

    .nav-link {
      display: flex;

      span {
        flex-grow: 0;
      }

      img {
        max-height: 2rem;
      }
    }
  }

  .nav-grid-head {
    margin-top: 2.5rem;
  }

  @include media-breakpoint-up(lg) {
    display: grid;
    grid-auto-flow: column;
    grid-column-gap: $grid-gap-lg;

    .nav-grid-head {
      margin-top: 0;
    }
  }
}


.col-lg {
  padding-left: 0;
  padding-right: 0;
}

@for $i from 1 through 6 {
  .cols-of-#{$i} {
    @include media-breakpoint-up(lg) {
      grid-template-rows: repeat($i, min-content);
    }
  }
}


// Grid styles (often not for cards) -------------------------------------------

.card-grid {
  display: grid;
  grid-gap: $grid-gap;
  padding: 0;
  width: 100%;
  grid-template-columns: 1fr; // Default to 1 big column on smaller screens

  @include media-breakpoint-up(lg) {
    grid-gap: $grid-gap-lg;
  }

  .col {
    padding-left: 0;
    padding-right: 0;
    min-width: 100%;
  }

  &.card-grid-4xN {
    /* 4 equal columns and any number of auto-sized rows. */
    grid-auto-rows: auto;
    grid-template-columns: repeat(2, 1fr);
    
    @include media-breakpoint-up(lg) {
      grid-template-columns: repeat(4, 1fr);
    }
  }


  &.card-grid-3xN {
    /* 3 equal columns and any number of auto-sized rows. */
    grid-auto-rows: auto;
    @include media-breakpoint-up(lg) {
      grid-template-columns: 1fr 1fr 1fr;
    }
    // @include media-breakpoint-up(lg) {
    //   margin-left: (-2 * $grid-gap-lg);
    //   margin-right: (-2 * $grid-gap-lg);
    // }
  }

  &.card-grid-2xN {
    /* 2 equal columns and any number of auto-sized rows. */
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;

    @include media-breakpoint-down(md) {
      /* Switch to 1-column layout on smaller widths */
      grid-template-columns: 1fr;
    }
  }

  &.card-grid-1x2 {
    /* 1 left columns and right 2x the size. */
    grid-template-columns: 1fr 2fr;
    grid-auto-rows: auto;

    /* No "hero" blocks expected here. */

    @include media-breakpoint-down(md) {
      /* Switch to 1-column layout on smaller widths */
      display: flex;
    }
  }


  .card {
    padding: 20px;
    border: 0;
    min-height: 264px;

    @include media-breakpoint-up(md) {
      min-height: 347px;
    }
    @include media-breakpoint-up(lg) {
      padding: 40px;
    }

    .card-body {
      padding: 8px;
      padding-bottom: 24px;

      .card-icon-container {
        width: 50px;
        height: 50px;

        img {
          width: 70%;
          height: 70%;
        }
      }
    }
  }

  &.section-hero {
    padding-left: 0;
  }

}

// New Page Layouts ---------------------------------------------------------------

.container-new {
  display: flex;
  flex-wrap: wrap;
  margin: 0 auto;
  padding: 0 32px;
  max-width: 100%;
  z-index: 1;
  @include media-breakpoint-up(md) {
    max-width: 608px;
  }
  @include media-breakpoint-up(lg) {
    max-width: 942px;
  }
  @include media-breakpoint-up(xl) {
    max-width: 1280px;
  }
}


/* Responsive design for different viewscreens ------------------------------ */

@include media-breakpoint-down(md) {
  article {
    overflow-wrap: break-word;
    word-wrap: break-word;
    overflow: hidden;
  }
}
@media (max-width: 480px) {
  html {
    overflow-x: hidden !important;
  }
}
@media (max-width: 400px) {
  .navbar .navbar-brand .brand-text {
    margin-right: 0;
    letter-spacing: -0.08rem;
  }
  .navbar .navbar-brand {
    margin-right: 0;
  }
  .navbar .navbar-brand .logo {
    margin-right: 0;
    margin-left: -1rem;
  }

  .btn {
    white-space: normal;
  }
}


/* TIMELINE */
.timeline-wrapper {
    z-index: 999;
    position: relative;
}
.timeline:before {
    content: '';
    position: absolute;
    top: -40px;
    left: 18px;
    height: 95%;
    width: 4px;
    background: linear-gradient(180deg, rgba(254, 255, 1, 1) 0%, rgba(255, 45, 154, 1) 33%, rgba(163, 8, 143, 1) 66%, rgba(44, 4, 128, 0.85) 100%);
    @include media-breakpoint-down(md) {
      left: 8px;
    }
 }

.timeline-dot {
  margin-top: 94px;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-pack: center;
  justify-content: center;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: $gray-900;
  box-sizing: border-box;
}

.timeline-block:first-child .timeline-dot {
  border: 3px solid $yellow-500;
}

.timeline-block:nth-child(2) .timeline-dot {
  border: 3px solid $orange-400;
}
.timeline-block:nth-child(3) .timeline-dot {
  border: 3px solid $red-purple-600;
}
.timeline-block:nth-child(4) .timeline-dot {
  border: 3px solid $red-purple-900;
}
.timeline-block {
    display: flex;
    position: relative;
    z-index: 1;
}

.timeline-content {
  flex-grow: 1;
  position: relative;
  margin-left: 1.25em;
}

.timeline h4 {
  margin-top: -4px;
}

@include media-breakpoint-up(md) {
  .timeline:before {
    left: 50%;
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
  }
  .timeline-dot {
    -ms-flex-order: 1;
    order: 1;
    margin-left: calc(5% - 9px);
    will-change: transform;
  }
  .timeline-block:nth-child(even) {
    -ms-flex-direction: row-reverse;
    flex-direction: row-reverse;
  }
  .timeline-dot {
    margin-right: calc(5% - 9px);
  }
  .timeline-content {
     width: 45%;
    -ms-flex-positive: 0;
    flex-grow: 0;
    will-change: transform;
    margin: 0;
    --line-height-multiplier: 1.2;
  }
}

@include media-breakpoint-up(lg) {
  [data-component-name="TableOfContent/TableOfContent"] {
    margin-right: 32px;
  }
}
